#pragma once

#ifndef __LIT__PREREQUISITES__INCLUDED__HH__
#define __LIT__PREREQUISITES__INCLUDED__HH__

#include <OgrePrerequisites.h>

#include "..\ProjectVersion.h"
#include <LitPointer.hpp>

#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
	#pragma comment(lib, "user32.lib")
#endif


namespace Lit
{
	struct Version{
		static const int Major=PROJECT_VERSION_MAJOR;
		static const int Minor=PROJECT_VERSION_MINOR;
		static const int Build=PROJECT_VERSION_BUILD;
		static const int Revision=PROJECT_VERSION_REVISION;
	};
	typedef Ogre::Vector2			Vec2;
	typedef Ogre::Vector3			Vec3;
	typedef Ogre::Vector4			Vec4;
	typedef Ogre::Quaternion		Quat;
	typedef Ogre::ColourValue		Color;
	typedef Ogre::AxisAlignedBox	AABB;
	typedef Ogre::Matrix3			Mat3;
	typedef Ogre::Matrix4			Mat4;
	typedef Ogre::Real				Real;
	typedef Ogre::Sphere			Sphere;

	typedef Ogre::Camera			ogre_camera_t;
	typedef Ogre::Entity			ogre_getEntity_t;
	typedef Ogre::Mesh				ogre_mesh_t;
	typedef Ogre::Mesh				ogre_material_t;
	typedef Ogre::Light				ogre_light_t;
	typedef Ogre::Log				ogre_log_t;
	typedef Ogre::SceneNode			ogre_scene_node_t;
	typedef Ogre::ManualObject		ogre_manual_obj_t;
	typedef Ogre::SceneManager		ogre_scene_mgr_t;
	typedef Ogre::RenderWindow		ogre_window_t;
	
	typedef RefPtr<ogre_camera_t>		OgreCameraPtr;
	typedef RefPtr<ogre_getEntity_t>	OgreEntityPtr;
	typedef RefPtr<ogre_light_t>		OgreLightPtr;
	typedef RefPtr<ogre_log_t>			OgreLogPtr;
	typedef Ogre::MeshPtr				OgreMeshPtr;
	typedef Ogre::MaterialPtr			OgreMaterialPtr;
	typedef RefPtr<ogre_manual_obj_t>	OgreManualObjPtr;
	typedef RefPtr<ogre_scene_mgr_t>	OgreSceneManagerPtr;
	typedef RefPtr<ogre_scene_node_t>	OgreSceneNodePtr;
	typedef RefPtr<ogre_window_t>		OgreRenderWindowPtr;

	template<typename T0, typename T1, typename T2> 
	struct triplet
	{
		T0 first;
		T1 second;
		T2 third;
		bool has_third;
			
		triplet( ) : first(), second(), third(), has_third(false){}

		triplet( T0 _first, T1 _second, T2 _third )
			: first(_first), second(_second), third(_third), has_third(true)
		{
		}
		triplet( T0 _first, T1 _second )
			: first(_first), second(_second), third(), has_third(false)
		{
		}

		triplet<T0,T1,T2>& operator=( const triplet<T0,T1,T2>& other )
		{
			first = other.first;
			second = other.second;
			third = other.third;
			has_third = other.has_third;
			return *this;
		}
	};
};

#define LIT_API_EXPORT __declspec(dllexport)
#define LIT_API_IMPORT __declspec(dllimport)

#ifdef LIT_EXPORT_LIBRARY
	#define LIT_API LIT_API_EXPORT
	#define LIT_API_EXPORT_ONLY LIT_API_EXPORT
#else
	#define LIT_API LIT_API_IMPORT
	#define LIT_API_EXPORT_ONLY 
#endif 
	
#include <LitEnumStr.h>

namespace Lit
{
	class LIT_API OgreDetails
	{
		OgreCameraPtr mCamera;
		OgreRenderWindowPtr mWindow;
		OgreSceneManagerPtr mSceneMgr;
	public:
		OgreDetails();
		OgreDetails( const OgreDetails& rk );
		~OgreDetails();

		OgreCameraPtr camera() const;
		OgreRenderWindowPtr window() const;
		OgreSceneManagerPtr sceneManager() const;
		
		void setCamera( OgreCameraPtr c );
		void setWindow( OgreRenderWindowPtr c );
		void setSceneManager( OgreSceneManagerPtr c );
	};
};

#endif